package io.terminus.entity.activeRecord;

import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.*;

/**
 * 员工表
 *  Active Record模式使用
 *
 * @author Melo
 */
@Data
@Builder
@ToString
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
public class Employee extends Model<Employee> {

    private static final long serialVersionUID = 1551892809833135054L;

    /**
     * 物理主键
     * @TableId(type = IdType.AUTO)被全局参数mybatis-plus.global-config.db-config.id-type代替
     */
    private Integer id;

    /**
     * 姓名
     */
    @TableField(value = "last_name", exist = true, condition = SqlCondition.LIKE)
    private String lastName;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 性别
     */
    private Integer gender;

    /**
     * 年龄
     */
    private Integer age;
}
